import { articles } from '@/api/index'
const state = {
  msgList: []
}
const mutations = {
  setMsgList (state, val) {
    state.msgList = val
  }
}
const getters = {}
const actions = {
  async getMsgList ({ commit }, id) {
    const { data: { data } } = await articles(id)
    commit('setMsgList', data.results)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  getters,
  actions
}
